<?php
/*
 * File name : donormain.php
 * Description :This is the ain page for php
 */
include_once "basePage.php";

class donormodel extends basePage{
	
	public function __construct()
    {
    }
    
 public function viewhistory(){
    	 $con = mysql_connect("localhost","pa_user","secret_password");
    	 if (!$con)
       		{
               die('Could not connect: ' . mysql_error());
      		 }
    	 mysql_select_db("tgs_gm_reservation", $con);
    	 $result = mysql_query("SELECT  Name,FedTaxID,WorkCompExpire,GenLiabExpire,FidelityAmount FROM TGS_GM_RESERVATION.tblagency");
    	 
    	 echo "<table border='1'>
		<tr>
		<th>Agency Name</th>
		<th>Tax ID</th>
		<th>WorkCompExpireDate</th>
		<th>GenLiabExpireDate</th>
		<th>Donation Amount</th>
		</tr>";
    	 
    	 while($row = mysql_fetch_array($result))
  			{
  				 echo "<tr>";
  			     echo "<td>" . $row['Name'] . "</td>";
                 echo "<td>" . $row['FedTaxID'] . "</td>";
                 echo "<td>" . $row['WorkCompExpire'] . "</td>";
                 echo "<td>" . $row['GenLiabExpire'] . "</td>";
                 echo "<td>" . $row['FidelityAmount'] . "</td>";
                 echo "</tr>";
               				
  			}
  			echo "</table>";
  			 return array($result,$row);
  		}
	public function donationhistory(){
		 $con = mysql_connect("localhost","pa_user","secret_password");
    	 if (!$con)
       		{
               die('Could not connect: ' . mysql_error());
      		 }
    	 mysql_select_db("tgs_gm_reservation", $con);
    	 	 echo "Welcome To Donor Page"; 	 
	}
	
	public function closeConn(){
    	mysql_close($con);
	}
}

$page = new donormodel();
$page->header();
$page->top_menu_donor();
$page->viewhistory();
//$page->facebook_post();
$page->footer();


?>